#ifndef CROPPING_H
#define CROPPING_H


#include <QColor>
#include <QPainter>
#include <QStyleOptionGraphicsItem>
#include <QWidget>
#include <iostream>
#include <QBrush>

#include "tooleffect.h"

class DrawingArea;

class Cropping : public ToolEffect{

public:
    //************************************************************* Constructor
    Cropping(DrawingArea* drawingAreaUse,QDockWidget* dockInfoTool);
    //************************************************************* Affichage of Dock Tool Info
    void createAffichage();
    //************************************************************* Cropping movement
    void beginSelectionRect(int x, int y);
    void selectionningRect(int x, int y);
    void endSelectionRect(int x, int y);
    //************************************************************* Crop
    void crop();
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
    //************************************************************* Get
    int getBeginX();
    int getBeginY();
    int getEndX();
    int getEndY();

protected :
    int xBegin;
    int yBegin;
    int xEnd;
    int yEnd;

private:
   bool isDrawingSelection;
   bool isDeselectionned;

};

#endif // CROPPING_H
